package com.jic.tuple;

import java.beans.ConstructorProperties;
import java.io.Serializable;
/**
 * description: Triple
 * date: 2020-01-10 11:58
 * author: wangys
 * version: 1.0
 */
public class Triple<F, S, T> implements Serializable {
    private static final long serialVersionUID = 2106948024356285042L;
    private F f;
    private S s;
    private T t;

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        } else if (obj == null) {
            return false;
        } else if (this.getClass() != obj.getClass()) {
            return false;
        } else {
            Triple other = (Triple)obj;
            if (this.f == null) {
                if (other.f != null) {
                    return false;
                }
            } else if (!this.f.equals(other.f)) {
                return false;
            }

            if (this.s == null) {
                if (other.s != null) {
                    return false;
                }
            } else if (!this.s.equals(other.s)) {
                return false;
            }

            if (this.t == null) {
                if (other.t != null) {
                    return false;
                }
            } else if (!this.t.equals(other.t)) {
                return false;
            }

            return true;
        }
    }

    public int hashCode() {
        long result = this.f != null ? (long)this.f.hashCode() : 0L;
        result = 31L * result + (long)(this.s != null ? this.s.hashCode() : 0);
        result = 31L * result + (long)(this.t != null ? this.t.hashCode() : 0);
        return (int)result;
    }

    public F getF() {
        return this.f;
    }

    public S getS() {
        return this.s;
    }

    public T getT() {
        return this.t;
    }

    public Triple<F, S, T> setF(F f) {
        this.f = f;
        return this;
    }

    public Triple<F, S, T> setS(S s) {
        this.s = s;
        return this;
    }

    public Triple<F, S, T> setT(T t) {
        this.t = t;
        return this;
    }

    public String toString() {
        return "Triple(f=" + this.getF() + ", s=" + this.getS() + ", t=" + this.getT() + ")";
    }

    public Triple() {
    }

    @ConstructorProperties({"f", "s", "t"})
    public Triple(F f, S s, T t) {
        this.f = f;
        this.s = s;
        this.t = t;
    }
}
